﻿using System.Collections.Generic;
using MiP.Common;
using MiP.ShellArgs.AutoWireAttributes;

namespace MiP.XmlCmd.Shell.Args
{
    public class Arguments
    {
        public Arguments()
        {
            TransformFiles = new List<string>();
            VariableSources = new List<VariableSource>();
            LogLevel = LogLevel.Info;
        }

        /// <summary>
        /// 	Gets or sets the filename of the base configuration. This is the base file that will be transformed by the files in <see name = "TransformFiles" />.
        /// </summary>
        [Option("source")]
        [Aliases("in")]
        [Required]
        [Position(1)]
        [ValueDescription("template")]
        public string SourceFile { get; set; }

        /// <summary>
        /// 	Gets or sets the filename for the result.
        /// </summary>
        [Option("destination")]
        [Aliases("out")]
        [Required]
        [Position(2)]
        [ValueDescription("result")]
        public string DestinationFile { get; set; }

        /// <summary>
        /// 	Gets or sets filenames of the transformation files which will be applied to the base configuration.
        /// </summary>
        /// <value>The XDT filenames.</value>
        [Option("transform")]
        [Aliases("t")]
        [ValueDescription("xdtFile")]
        public ICollection<string> TransformFiles { get; set; }

        // this property is here for the argument parser, values will be added to VariableSources by an event
        [Option("set")]
        [Aliases("s")]
        [ValueDescription("name=value")]
        public ICollection<string> Variables { get; set; }

        // this property is here for the argument parser, values will be added to VariableSources by an event
        [Option("loadvars")]
        [Aliases("lv")]
        [ValueDescription("variableFile")]
        public ICollection<string> VariableFiles { get; set; }

        [IgnoreOption]
        internal ICollection<VariableSource> VariableSources { get; set; }

        [Option("log")]
        public LogLevel LogLevel { get; set; }
    }
}